<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>修改人员信息</title>
    <link rel="stylesheet" href="${base}/static/res/manage/css/common.css" >
    <link rel="stylesheet" href="${base}/static/res/manage/css/ec.css" >
    <link rel="stylesheet" href="${base}/static/res/manage/css/list.css" >
    <script type="text/javascript" src="${base}/static/res/plugin/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/plugin/validator/jquery.validate.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/common.js"></script>
    <script type="text/javascript">
        $(function(){

            $("#inputForm").validate({
                rules:{
                    userName:{
                        required:true,
                        checkUserName:true
                    },
                    mobile:{
                        required:true,
                        mobile:true,
                        remote: {
                            url:"checkMobile.jhtml?id=${admin.id}",
                            cache:false
                        }
                    },
                    email:{
                        email:true
                    }
                },
                messages:{}
            });

			[#--//重置密码--]
			[#--$("#rePassword").click(function(){--]
				[#--if(confirm("您确定要重置此人员密码吗？（重置后密码为admin123）")){--]
					[#--$.post(--]
						[#--"rePassword.jhtml",--]
						[#--{"id":"${intfc.id}"},--]
						[#--function(data){--]
							[#--if(data.success){--]
                                [#--$.message("success","操作成功");--]
							[#--}--]
						[#--}--]
					[#--);--]
				[#--}--]
			[#--});--]

        });
    </script>
</head>
<body>
	<form id="inputForm" action="update.jhtml" method="post">
		<input type="hidden" name="id" value="${admin.id}"/>
		<div class="tab set arr">
			<h3><a href="list.jhtml">人员管理</a><a href="edit.jhtml?id=${admin.id}">>  编辑人员</a></h3>
			<div class="tablist message">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td><label>人员名称<span class="cred">*</span></label></td>
						<td>
							<input type="text" name="userName" id="userName" value="${admin.userName}"/>
						</td>
						<td><label>手机号码<span class="cred"> * </span></label></td>
						<td><input type="text" name="mobile" value="${admin.mobile}"/></td>
					</tr>
					<tr>
						<td><label>人员邮箱</label></td>
						<td><input type="text" name="email" value="${admin.email}"/></td>
                        <td><label>是否可用<span class="cred"> * </span></label></td>
                        <td>
                            <label class="sexs"><input type="radio" name="status" class="sex" value="0"[#if admin.status == 0] checked[/#if]> 是</label>
                            <label class="sexs"><input type="radio" name="status" class="sex" value="1"[#if admin.status == 1] checked[/#if]> 否</label>
                        </td>
					</tr>
					<tr class="check">
						<td><label>角色</label></td>
						<td>
						[#list roles as role]
							[#if role.roleCode != "ROLE_ADMIN"]
							<label class="disblock">
								<input name="roleIds" type="checkbox" value="${role.id}"
									[#list children as roleChildren]
									   [#if roleChildren.id==role.id]checked[/#if]
									[/#list]
								/>
								${role.roleName}&nbsp;&nbsp;
                            </label>
							<br/>
							[/#if]
						[/#list]
						</td>
					</tr>
				</table>
				<p class="save">
					<input type="submit" value="保存" class="red">
					<input type="button" value="取消" class="red" id="backButton">
					[#--<input type="button" value="重置密码" class="red" id="rePassword">--]
				</p>
			</div>
		</div>
	</form>
</body>
</html>